<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/6/30
  Time: 14:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>2：用jsp在网页中输出1900-2020之间的闰年</title>
</head>
<body>
<h2>1900-2020之间的闰年：</h2>
<%
    for (int i = 1900; i < 2021; i++) {
        if ((i % 400 == 0) || (i % 100 != 0 && i % 4 == 0)) {
            out.print("<h3>" + i + "</h3>");
            out.print("<br/>");
        }
    }
%>
<%
    if(application.getAttribute("count")==null){
        application.setAttribute("count",0);
    }

    int count=Integer.parseInt(application.getAttribute("count").toString());
    count++;
    application.setAttribute("count",count);
%>
<div>访问次数：<%=application.getAttribute("count")%></div>
</body>
</html>
